import 'dart:convert';
import 'package:flutter/material.dart';
import './RequestUtil.dart';
import '../../util/HttpUtils.dart';

class RequestTest extends StatefulWidget {
  @override
  _RequestTestState createState() => _RequestTestState();
}

class _RequestTestState extends State<RequestTest> {
  @override
    void initState() {
      // print(RequestUtils.getData("http://39.108.246.130/api/user/getuserinfo"));
      HttpUtils.post("http://39.108.246.130/api/auth/login", (var data) {
        print(json.decode(data));
      }, params: <String, String>{"account":"admin", "password": "admin123456"});
      super.initState();
    }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('text'),
      ),
      body: Container(
        padding: EdgeInsets.all(32.0),
        child: Center(
          child: Column(
            children: <Widget>[],
          ),
        ),
      ),
    );
  }
}